package pro.cherish.knowledgeumldesignpattern.designPattern.com.cherish.proxy.JdkProxy;

import java.lang.reflect.Proxy;

public class client {
    public static void main(String [] args){
        RealStar realStar = new RealStar();
        StarHandler starHandler = new StarHandler(realStar);
//        调用出构造代理对象
        Star star= (Star) Proxy.newProxyInstance(ClassLoader.getSystemClassLoader(), new Class[]{Star.class}, starHandler);
        star.bookTicker();
        star.sing();
        System.out.println(star);
    }
}
